li = []

N = 3
for i in range(N):
    dic = {}
    dic['name'] = input('name:')
    dic['city'] = input('city:')
    dic['age'] = input('age:')
    li.append(dic)

# li=[{'name':'marry','city':'bj','age':'20'},{'name':'tom','city':'sh','age':'30'}]
li.sort(key=lambda x:x['age'], reverse=True)
for i in li:
    print(li)


